#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
int sim_strncmp(const char* s1, const char* s2, size_t count)
{
	assert(s1 && s2);

	if (*s1 == '\0' || *s2 == '\0')
	{
		return *s1 - *s2;
	}

	while (count--)
	{
		if(*s1 == *s2 && count != 0)
		{
			s1++;
			s2++;
		}
		else
		{
			break;
		}
	}
	return *s1 - *s2;
}

//int main()
//{
//	char ch1[] = "abcd";
//	char ch2[] = "abcq";
//	printf("%d", sim_strncmp(ch1, ch2, 3));
//	return 0;
//}